package zhibi.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.common.Mapper;
import zhibi.domain.Member;
import zhibi.extra.base.BaseServiceImpl;
import zhibi.extra.pojo.MemberPo;
import zhibi.frame.domain.Page;
import zhibi.frame.mybatis.example.Example;
import zhibi.mapper.MemberMapper;
import zhibi.service.MemberService;

/**
 * Created by 执笔 on 2018/3/24.
 */
@Service
@Transactional
public class MemberServiceImpl extends BaseServiceImpl<Member> implements MemberService {
    @Autowired
    public MemberServiceImpl(MemberMapper mapper) {
        super(mapper);
    }

    @Autowired
    private MemberMapper memberMapper;

    @Override
    public PageInfo<MemberPo> selectPoByExample(Example example, Page page) {
        PageHelper.startPage(page.getPageNum(),page.getPageSize());
        return new PageInfo<MemberPo>(memberMapper.selectPoByExample(example),5);
    }
}
